package com.zxy.zxyrpc.fault.tolerant;

import com.zxy.zxyrpc.exception.RpcException;
import com.zxy.zxyrpc.model.ErrorCode;
import com.zxy.zxyrpc.model.RpcResponse;

import java.util.Map;

/**
 * 容错策略 - 快速失败（立即通知外层调用方）
 *
 * @author zxy
 * @since 2025/5/29
 **/
public class FailFastTolerantStrategy implements TolerantStrategy {
    @Override
    public RpcResponse doTolerant(Map<String, Object> content, Exception e) {
        throw new RpcException(ErrorCode.OPERATION_ERROR, "服务调用错误");
    }
}
